#version 430 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aNormal;
layout (location = 2) in vec4 aInstancePosRadius;
layout (location = 3) in vec3 aInstanceColor;

out vec3 FragPos;
out vec3 Normal;
out vec3 Color;

uniform mat4 projection;
uniform mat4 view;

void main()
{
    float scale = aInstancePosRadius.w;
    vec3 worldPos = vec3(aPos.x*scale,aPos.y*scale,aPos.z*scale);
    worldPos += aInstancePosRadius.xyz;
    FragPos = worldPos;
    Normal = aNormal;
    Color = aInstanceColor;
    //Color = aInstancePosRadius.xyz;

    gl_Position = projection * view * vec4(worldPos,1.0f);
}
